// Problem 176: Right-angled triangles that share a cathetus
//
// The four right-angled triangles with sides (9,12,15), (12,16,20), (5,12,13) and (12,35,37) all have one of the shorter sides (catheti) equal to 12. It can be shown that no other integer sided right-angled triangle exists with one of the catheti equal to 12.
// Find the smallest integer that can be the length of a cathetus of exactly 47547 different integer sided right-angled triangles.
// --------
// ref: https://oeis.org/A046079, Formula:
// if n=2^k0*3^k1*5^k2*...*p^kn
// f(n)=((2*k0-1)*(2*k1+1)*(2*k2+1)*...*(2*kn+1)-1)/2 k0>0
// f(n)=((2*k1+1)*(2*k2+1)*...*(2*kn+1)-1)/2 k0=0
//
// 47547*2+1=95095=5*7*11*13*19
// ans=2^10*3^6*5^5*7^3*11^2

package main

import (
	"fmt"
	"projecteuler/euler"
)

func p176() {
	ans := euler.IntPow(2, 10) * euler.IntPow(3, 6) * euler.IntPow(5, 5) * euler.IntPow(7, 3) * euler.IntPow(11, 2)
	fmt.Println("Problem 176:", ans)
}
